package org.niu.sort;

import sun.jvm.hotspot.utilities.Assert;

import java.util.*;

public class DistributeCandies {
    public int distributeCandies(int[] candyType) {
        int size = candyType.length/2;
        int type=0;
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < candyType.length; i++) {
            set.add(candyType[i]);
        }

        return Math.min(size,set.size());
    }

}
